package com.teachoa.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class BlankTag extends TagSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4564861302612155867L;
	
	private int num;
	
	private String createHtml(int num) {
		String html = "<font color='white'>";
		for(int i=0;i<num;i++) {
			html+="一";
		}
		html+="</font>";
		return html;
	}
	
	@Override
	public int doStartTag() throws JspException {
		try {
			pageContext.getOut().write(createHtml(num));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return super.doStartTag();
	}
	
	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

	public static void main(String[] args) {
		BlankTag pt = new BlankTag();
		//pt.setMap(Maps.newHashMap("pageNo", 3, "total", 15, "js", "page"));
		//pt.init(Maps.newHashMap("pageNo", 3, "total", 25, "js", "page"));
		//System.out.println(pt.getPageHtml());
		System.out.println(pt.createHtml(3));
		
	}

}
